#include <stdio.h>

/*常胜将军*/

void main()
{
    int a=21,i;
    printf("Game begin:\n");
    while(a>0)
    {
        do{
            printf("How many sticks do u wish to take(1~%d)?",a>4?4:a);
            scanf("%d",&i);
        }
        while(i>4||i<1||i>a);
        if(a-i<0) printf("%d stickk left in the pile.\n",a-1);
        if((a-i)<=0) {
            printf("You've taken the last stick.\n");
            printf("YOU LOSE!\nGAMEOVER.\n");
            break;}
            else
            printf("Computer take %d sticks.\n",5-i);
            a-=5;
            printf("%d sticks left in the pile.\n",a);
    }
}